package com.belf.console.domain;

import com.belf.common.annotation.Excel;
import com.belf.common.core.domain.BaseEntity;
import com.belf.console.domain.entity.ColumnSyncConf;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.List;

/**
 * 批量同步配置对象 data_batch_conf
 * 
 * @author belf
 * @date 2024-08-20
 */
@Data
@EqualsAndHashCode(callSuper=false)
public class DataBatchConf extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** $column.columnComment */
    private Long id;

    /** 任务ID */
    @Excel(name = "任务ID")
    private Long taskId;
    private Long jobId;

    /** 表名 */
    @Excel(name = "表名")
    private String tableName;

    /** 同步类型 */
    @Excel(name = "同步类型")
    private String syncType;

    /** 每次读取的行数 */
    @Excel(name = "每次读取的行数")
    private Integer pageSize;

    /** 读取分片数 */
    @Excel(name = "读取分片数")
    private Integer slice;

    /** 每片500万行或5G数据 */
    @Excel(name = "每片500万行或5G数据")
    private Integer sliceSize;

    /** 排序方式 */
    @Excel(name = "排序方式")
    private String sortBy;

    /** 最后偏移值 */
    @Excel(name = "最后偏移值")
    private String last;

    /** 字段配置 */
    @Excel(name = "字段配置")
    private String columnSyncConfMap;

    private List<ColumnSyncConf> columns;

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("taskId", getTaskId())
            .append("tableName", getTableName())
            .append("syncType", getSyncType())
            .append("pageSize", getPageSize())
            .append("slice", getSlice())
            .append("sliceSize", getSliceSize())
            .append("sortBy", getSortBy())
            .append("last", getLast())
            .append("columnSyncConfMap", getColumnSyncConfMap())
            .toString();
    }
}
